@echo off  

if '%1=='## goto ENVSET  

set scriptdir=%~dp0
set APP_HOME=%scriptdir%
set APP_CONFIG=conf/application.properties
set EBEAN_CONFIG=conf/ebean.properties
set APP_PORT=9200
set BOOT_OPTS=--server.port=%APP_PORT%
set JAVA_OPTS=-Debean.props.file=%EBEAN_CONFIG% -Dfile.encoding=UTF-8 -Xmx1024M -Xms64M -Xss256K -XX:MaxPermSize=256M -XX:+UseParallelGC


SET LIBDIR=lib
set MODULEDIR=modules 

SET CLSNAME=com.teamclub.App

SET CLSPATH=""
FOR %%c IN (%APP_HOME%lib\*.jar) DO CALL %0 ## %%c 
FOR %%x IN (%APP_HOME%modules\*.jar) DO CALL %0 ## %%x

GOTO RUN  

:RUN  
java %JAVA_OPTS% -cp %CLSPATH% %CLSNAME% %BOOT_OPTS%
goto END  

:ENVSET  
set CLSPATH=%CLSPATH%;%2
goto END  

:END  